﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Mapping;
using NHibernate;
using FluentNHibernate.Data;

namespace BankCreditPortfolio.DAL.Entities
{
    public class Credit
    {
        public virtual int CreditId { get; set; }
        public virtual DateTime DeliveryDate { get; set; }
        public virtual Deposit Deposit { get; set; }
    }

    public class CreditMap : ClassMap<Credit>
    {
        public CreditMap()
        {
            Id(x => x.CreditId).GeneratedBy.HiLo("credit");
            Id(x => x.CreditId).Unique();
            Map(x => x.DeliveryDate);
            References(x => x.Deposit).Column("DepositId");
            Table("Credit");
        }
    }
}
